/*
 * BlockNode.h
 *
 *  Created on: Jul 7, 2009
 *      Author: elkobir
 */

#ifndef BLOCKNODE_H_
#define BLOCKNODE_H_

#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <vector>
#include <sstream>
#include "MetadataBlock.h"
#include "Utils.h"
#include "Log.h"
using namespace std;

#define EMPTY -9

class BlockNode {
	vector<int> _addresses;
	int _addressesInBlockCount;
	int _blockSizeInBytes;
	int _next;

public:
	BlockNode(int blockSizeInBytes);
	BlockNode(int blockSizeInBytes, unsigned char* data);
	virtual ~BlockNode();

	unsigned char* toBytes();
	void fromBytes(unsigned char* data);

	bool isFull();
	bool isEmpty();
	int removeAddress();
	int addAddress(int address);
	int _nextBlockAddress;


};

#endif /* BLOCKNODE_H_ */
